<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="mainMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="2" />
<title>部门管理</title>
<script type="text/javascript"
	src="<c:url value='/ext/ui/jquery-ui-1.8.12.custom.min.js'/>"></script>
<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css"
	rel="stylesheet" />
<script type="text/javascript">
	$(document).ready(function(){
		$("#addDept").click(function(){
			location.href= "${ctx}/account/department!input.action?organizationId=${organizationId}";
		});
	});
</script>
</head>
<body>
<form id="mainForm" action="department.action" method="post"
	class="yform"><input type="hidden" name="page.pageNo"
	id="pageNo" value="${page.pageNo}" /> <input type="hidden"
	name="page.orderBy" id="orderBy" value="${page.orderBy}" /> <input
	type="hidden" name="page.order" id="order" value="${page.order}" />

<div id="message"><s:actionmessage theme="custom"
	cssClass="success" /></div>
<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul
	class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all ui-sortable">
	<li><a id="construction" class="ui-state-default ui-corner-top   "
		href="${ctx}/account/inside_organization!input.action?id=${organizationId}">内部单位</a></li>
	<c:if test="${fn:length(organizationId)!=0}">
	<li><a id="construction" class="ui-state-default ui-corner-top  ui-tabs-selected ui-state-active "
		href="${ctx}/account/department.action?organizationId=${organizationId}">单位部门</a>
		<input  type="hidden" name="organizationId" value="${organizationId}"/>
		</li>
	</c:if>
</ul>
<div id="content">
<table id="contentTable">
	<tr>
		<th><a href="javascript:sort('depName','asc')">部门名称</a></th>
		<th><a href="javascript:sort('depCode','asc')">机构代码</a></th>
		<th><a href="javascript:sort('depType','asc')">机构类别</a></th>
		<th>职工人数</th>
		<th>所属单位</th>
		<th>操作</th>
	</tr>

	<c:forEach items="${page.result}" var="dept">
		<tr>
			<td>${dept.depName}&nbsp;</td>
			<td>${dept.depCode}&nbsp;</td>
			<td>${dept.depType}&nbsp;</td>
			<td>${dept.staffers}&nbsp;</td>
			<td>${dept.organization.orgName}</td>
			<td>&nbsp;
				<a href="department!input.action?id=${dept.id}">修改</a>&nbsp;
				<a href="department!delete.action?id=${dept.id}&organizationId=${organizationId}">删除</a>
		</td>
		</tr>
	</c:forEach>
</table>
</div>
</div> 
<div>第${page.pageNo}页, 共${page.totalPages}页 <a
	href="javascript:jumpPage(1)">首页</a> <s:if test="page.hasPre">
	<a href="javascript:jumpPage(${page.prePage})">上一页</a>
</s:if> <s:if test="page.hasNext">
	<a href="javascript:jumpPage(${page.nextPage})">下一页</a>
</s:if> <a href="javascript:jumpPage(${page.totalPages})">末页</a></div>
<div class="type-button">
<input type="button" id="addDept" class="add"    value="新增"/></div>
</form>


</body>
</html>
